package com.cpi.cornpp.salesforcast.helper;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import org.apache.struts.util.LabelValueBean;

import com.cs.common.init.SystemParameterCollection;
import com.cs.common.init.beans.SystemParameterBean;

public class SalesForecastHelper {
	private static final String PURCHASE_INSTRUCTION_FUTURES_PERIOD_YEARS = "PURCHASE_INSTRUCTION_FUTURES_PERIOD_YEARS";//$NON-NLS-1$
	public List labelValueYears(){
		List labelValues = null;
		Calendar cal_today = null;
		LabelValueBean labelValueBean = null;
		int startYear = 0;
		int maxYears = 0;
		SystemParameterCollection systemParameterCollection = null;
		SystemParameterBean systemParameterBean = null;
		try{
			systemParameterCollection = SystemParameterCollection.getInstance();
			systemParameterBean = systemParameterCollection.getSystemParameterBean(PURCHASE_INSTRUCTION_FUTURES_PERIOD_YEARS);
			labelValues = new ArrayList(0);
			cal_today = Calendar.getInstance();
			startYear = cal_today.get(Calendar.YEAR);
			maxYears = systemParameterBean.getIntValue();
			for(int index = startYear;index<=startYear + maxYears; index++){
				labelValueBean = new LabelValueBean(String.valueOf(index), String.valueOf(index));
				labelValues.add(labelValueBean);
			}
		}finally{}
		return labelValues;
	}
}